﻿//-----------------------------------------------------------------------
// <copyright file="MessageResult.cs" company="deixei.com">
//     Copyright (c) deixei.com. All rights reserved.
// </copyright>
// <author>Marcio Parente</author>
//---------------------------------------------------------------------
namespace Deixei.Infrastructure
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;

    /// <summary>
    /// Message Result. To send content data of any type and information with a status to the user or next layer.
    /// </summary>
    /// <typeparam name="T"></typeparam>
    public class MessageResult<T>
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="MessageResult{T}" /> class.
        /// </summary>
        public MessageResult()
        { 
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="MessageResult{T}" /> class.
        /// </summary>
        /// <param name="content">The content.</param>
        /// <param name="message">The message.</param>
        /// <param name="status">The status.</param>
        public MessageResult(T content, string message = "", MessageStatus status = MessageStatus.Success)
        {
            this.Content = content;
            this.Message = message;
            this.Status = status;
        }

        /// <summary>
        /// Gets or sets the status.
        /// </summary>
        /// <value>
        /// The status.
        /// </value>
        public MessageStatus Status { get; set; }
        /// <summary>
        /// Gets or sets the message.
        /// </summary>
        /// <value>
        /// The message.
        /// </value>
        public string Message { get; set; }

        /// <summary>
        /// Gets or sets the content.
        /// </summary>
        /// <value>
        /// The content.
        /// </value>
        public T Content { get; set; }
    }


    /// <summary>
    /// Message Result. To send a string content and information with a status to the user or next layer.
    /// </summary>
    public class MessageResult : MessageResult<string>
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="MessageResult" /> class.
        /// </summary>
        public MessageResult() : base()
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="MessageResult" /> class.
        /// </summary>
        /// <param name="content">The content.</param>
        /// <param name="message">The message.</param>
        /// <param name="status">The status.</param>
        public MessageResult(string content, string message = "", MessageStatus status = MessageStatus.Success) : base(content, message, status)
        {
        }
    }
}
